package com.litian.dancechar.gateway.service;

import com.litian.dancechar.framework.common.base.RespResult;
import com.litian.dancechar.gateway.feign.system.client.UserClient;
import com.litian.dancechar.gateway.feign.system.dto.SystemUserReqDTO;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * 黑名单用户服务
 *
 * @author tojson
 * @date 2021/6/22 09:51
 */
@Component
public class BlackListUserService {
    @Resource
    private UserClient userClient;

    /**
     * 是否黑名单用户
     */
    public boolean isBlackListUser(String accountNo) {
        SystemUserReqDTO systemUserReqDTO = new SystemUserReqDTO();
        systemUserReqDTO.setAccountNo(accountNo);
        RespResult<Boolean>  respResult = userClient.isBlackList(systemUserReqDTO);
        return respResult != null && respResult.isOk()? respResult.getData() : false;
    }
}